#!/bin/sh

#install docker
echo "waiting for updating"
sudo apt-get update

echo "installing some tools..."
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

echo "add docker key..."
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -


echo "add repository..."
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

echo "waiting for updating..."
sudo apt-get update

echo "installing docker-ce..."
sudo apt-get install docker-ce

docker -v

echo "installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose
echo "docker&docker-composer install successfully!"

echo "staring deployment"
sudo make dev
echo "deployment complate!"
